import logging.config

import yaml

from transform_excel_tools.util import conf_utils, path_utils


class LogUtils(object):
    class LoggingUtils(object):
        with open(path_utils.app_path() + '/config/logging.yml', "r") as f:
            conf = yaml.load(f, Loader=yaml.FullLoader)
            conf["handlers"]["file"]["filename"] = conf_utils.get_logging_file_conf()
            logging.config.dictConfig(conf)

    @classmethod
    def get_logger(cls, name):
        return logging.getLogger(name)
